#ifndef EVENT_RECEIVER
#define EVENT_RECEIVER

#include "config.h"
#include "../os/os.h"
#include "../math/array.h"
#include "../math/vector2d.h"
#include "../../gui/type.h"
#include "keycode.h"

namespace sleek
{
    namespace gui
    {
        class frame;
        enum INTERFACE_EVENT_CODE;
        enum INTERFACE_GUI_CODE;
    }
    namespace core
    {
        namespace device
        {
            struct input;
            class event
            {
                public:
                    event();
                    ~event();

                    virtual void force(input);
                    virtual bool manage(input*);
                    virtual void exit();
                protected:
                    void kill();
                    void reset();
                    input *current;
                private:
                    friend class Device;
                    friend class Device_sdl;
                    friend class Device_win;
                    friend class Device_x11;
                    friend class Device_xf86;
                    bool asRunning;
            };
            struct input
            {
                input();
                void operator = (input);
                void clear();

                bool exit_msg;
                EVENTCODE type;
                bool mouse[MOUSE_CODE_COUNT];
                bool key[KEY_KEY_CODES_COUNT];

                struct
                {
                    class gui::frame*called;
                    gui::INTERFACE_GUI_CODE type;
                    gui::INTERFACE_EVENT_CODE code;
                } gui;

                math::vector2di mouse_pos;
            };
        }
    }
}
#endif // EVENTRECEIVER_H
